package io.gitee.minelx.example.geohash;

import java.util.Arrays;

public class Base32 {
    private static final String PATTERN = "0123456789bcdefghjkmnpqrstuvwxyz";

    public static char forward(int index) {
        return PATTERN.charAt(index);
    }

    public static int backward(char codePoint) {
        return Arrays.binarySearch(PATTERN.toCharArray(), codePoint);
    }
}
